package com.java110.mall.chain.adapt.order;

import com.alibaba.fastjson.JSONObject;
import com.java110.dto.data.DatabusDataDto;
import com.java110.intf.chain.IPrintOrderV1InnerServiceSMO;
import com.java110.mall.chain.adapt.IDatabusAdapt;
import com.java110.utils.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("printOrderReceiptDataBus")
public class PrintOrderReceiptDataBus implements IDatabusAdapt {

    @Autowired
    private IPrintOrderV1InnerServiceSMO printOrderV1InnerServiceSMOImpl;

    @Override
    public void execute(DatabusDataDto databusDataDto) throws Exception {

        String orderId = databusDataDto.getBusinessId();
        if (StringUtil.isEmpty(orderId)) {
            throw new IllegalArgumentException("未包含订单ID");
        }

        printOrderV1InnerServiceSMOImpl.printStoreOrder(orderId);


    }
}
